﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using ZHDJ.Core;
using ZHDJ.Core.Util;
using ZHDJ.Data;
using ZHDJ.Data.DataCaching;

namespace ZHDJ.WebPage.Master
{
    public class MorePageMaster: System.Web.UI.MasterPage
    {

        

        /// <summary>
        /// 模块
        /// </summary>
        public string Module
        {
            get; set;
        }

        /// <summary>
        /// 模块名称
        /// </summary>
        public string ModuleName
        {
            get; set;
        }
        /// <summary>
        /// 类型(为空时，选择第一个)
        /// </summary>
        public string Category
        {
            get; set;
        }

        #region 页面跳转
        /// <summary>
        /// 网站域名
        /// </summary>
        public string WebHost
        {
            get { return SystemParameterCaching.Get(SystemParameterKey.WebHost); }
        }

        

        public void RedirectTo(string toType, string url, Action<Dictionary<string, string>> para = null)
        {
            if (SystemParameterCaching.Get(SystemParameterKey.EnableRedirectTo) != "1")
            {
                Response.Redirect(url);
            }
            else
            {
                PageUtility.RedirectTo(this.Page, WebHost, toType, url, para);

            }
        }
        /// <summary>
        /// 跳转到首页
        /// </summary>
        public void RedirectToDefault()
        {
            RedirectTo("default", "~/default.aspx");
        }
        #endregion
    }
}
